package books;

/**
 * @Author MDD
 * @Description
 * @Version
 * @Date
 **/
public class Books {
    private String name;
    private String author;
    private String press;
    private double price;

    public Books(){}

    public Books(String name,String author,String press,double price) {
        this.setName(name);
        this.setAuthor(author);
        this.setPress(press);
        this.setPrice(price);
    }

    public void info(Books info){
        System.out.println("书籍名称："+this.name+"\n作者："+this.author+"\n出版社："+this.press+"\n价格："+this.price);
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAuthor() {
        return this.author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getPress() {
        return this.press;
    }

    public void setPress(String press) {
        this.press = press;
    }

    public double getPrice() {
        return this.price;
    }

    public void setPrice(double price) {
        if (price>10){
            this.price = price;
        }
        else{
            System.out.println("图书价格必须大于10！");
        }
    }
}
